package com.ts.api.http.receive.notice.pull;

import com.gitee.apanlh.util.base.MapUtils;
import com.ts.api.common.constant.api.ApiApplyQueryStatusEnum;
import com.ts.api.module.api.convert.core.annotation.ApiReceive;
import com.ts.api.module.api.convert.core.annotation.ApiReceiveConvertType;
import com.ts.api.module.api.convert.receive.entity.ApiReceiveNotice;
import com.ts.api.module.api.convert.receive.handler.ApiReceiveNoticeHandler;

import java.util.Map;

/**
 *  上游-默认拉取进件通知通知器
 *
 *  @author Pan
 */
@ApiReceive(apiClientId = "客户端id", type = ApiReceiveConvertType.API_NOTICE_PULL)
public class ApiReceivePullApplyNoticeTest implements ApiReceiveNoticeHandler {

    @Override
    public Map<String, Object> buildRequest(ApiReceiveNotice apiReceiveNotice) throws Exception {
        String applyId = apiReceiveNotice.getPhoneMd5();

        return MapUtils.newHashMap(newMap -> {
            newMap.put("applyId", applyId);
            newMap.put("phoneMd5", applyId);
            newMap.put("status", ApiApplyQueryStatusEnum.SUC.getType().toString());
        });
    }

    @Override
    public boolean hasSuc(String respJson) throws Exception {
        return true;
    }
}
